package com.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Component;

/**
 * @User 小菜鸡
 * @Data 2020/5/9
 */
@Component
public class MyService {

    @Autowired
    private MongoTemplate mongoTemplate;

    //测试mongodb连接成功
    public void test(){
        System.out.println(mongoTemplate);
    }
}
